package com.yanqu.road.server.gameplayer.module.activity.langyamemorial;

import com.yanqu.road.entity.activity.langyamemorial.LangYaMemorialLight;
import com.yanqu.road.entity.activity.langyamemorial.LangYaMemorialUserData;
import com.yanqu.road.pb.activity.LangYaMemorialProto;

public class LangYaMemorialActivityPb {

    public static LangYaMemorialProto.LangYaMemorialUserData.Builder buildUserData(LangYaMemorialUserData userData) {
        LangYaMemorialProto.LangYaMemorialUserData.Builder builder = LangYaMemorialProto.LangYaMemorialUserData.newBuilder();
        builder.setScore(userData.getScore());
        builder.setProgress(userData.getProgress());
        builder.setBigRewardTimes(userData.getBigRewardTimes());
        builder.setBuildTimes(userData.getBuildTimes());
        builder.setCommonTimes(userData.getCommonTimes());
        builder.setBuildValue(userData.getBuildValue());

        for (LangYaMemorialLight light : userData.getLightList()) {
            LangYaMemorialProto.LangYaMemorialLightMsg.Builder lightBuild = LangYaMemorialProto.LangYaMemorialLightMsg.newBuilder();
            lightBuild.setId(light.getId());
            lightBuild.setGet(light.getGet());
            builder.addLight(lightBuild);
        }
        return builder;
    }
}
